#ifndef _INTERFACE_HANDLER
#define _INTERFACE_HANDLER

enum Interfaces
{
	INTERFACE_CHAT		= 0x00,
	NUM_INTERFACES,
};

enum InterfaceError
{
	QUERY_INTERFACE_SUCCESS				= 0x00,
	QUERY_INTERFACE_POINTER_UNINIT		= 0x01,
	QUERY_INTERFACE_UNK_INTERFACE		= 0x02,
	QUERY_INTERFACE_NOT_AVAILABLE		= 0x03,
};

class DLL_EXPORT IUnkInterface abstract
{
	friend class InterfaceHandler;
	Interfaces InterfaceType;
};

class DLL_EXPORT InterfaceHandler : public Single<InterfaceHandler>
{
	stdext::hash_map<Interfaces, IUnkInterface*> m_interfaces;
public:
	InterfaceError QueryInterface(Interfaces type, void** pOut);
};

#define sInterfaceHandler (*(InterfaceHandler::getSingle()))

#endif